package com.project.repositoryImpl;

import com.Entity.DzmHisDoctorEntity;
import com.project.repository.RepositoryDzmHisDoctor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

public interface RepositoryDzmHisDoctorImpl extends RepositoryDzmHisDoctor,JpaRepository<DzmHisDoctorEntity,Integer> {

    
    @Override
    @Query(value = "select a.hospital_id,a.department_id,a.physicianid,a.title_level,b.true_name,b.introduction,b.picture,b.background,b.phone,b.mailbox,b.strong,b.honor,b.ask_price,b.id " +
                   "from dzm_his_hospital_doctor_relation a,dzm_his_doctor b " +
                   "where a.physicianid = b.id and a.hospital_id = :hid and a.department_id = :did",nativeQuery = true)
    List<Map<String, Object>> gethospitalDoctors(@Param("hid") String hid,@Param("did")String did);

    @Override
    @Query(value = "select * " +
                   "from dzm_his_doctor " +
                   "where id = :doctor_id",nativeQuery = true)
    DzmHisDoctorEntity queryDoctorInfo(@Param("doctor_id") Integer doctor_id);
}
